<script>
var _siteUrl = '<?php echo  Yii::app()->params['siteUrl']?>';

$(function() {
	var validator = $("#form1").validate({
		rules: {
			name: "required",
			code: "required",
			manager: "required",
			manager_unique_id : "required"
		},
		messages: {
			name: {
				required: "请输入名称!"
			},
			code:{
				required: "请输入CODE!"
			},
			manager_unique_id: {
				required: "请输入主管工号!"
			},
			manager: {
				required: "请输入主管名!"
			}
		},
		errorPlacement: function(error, element) {
			if ( element.is(":radio") )
				error.appendTo( element.parent().next().next() );
			else if ( element.is(":checkbox") )
				error.appendTo ( element.next() );
			else
				error.appendTo( element.parent().next() );
		},
		submitHandler: function(form) {
			$("#form_submit").attr("disabled","disabled");
			form.submit();
		}
	});
});
</script>
<?php
/* @var $this DepartmentController */
/* @var $model UserDepartment */
Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . "/global/js/pages/department.js");
Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . "/global/js/plugins/jquery.validate.js");
$this->breadcrumbs=array(
	'User Departments'=>array('index'),
	'Create',
);
?>
<span class="page_h3">添加 CODE</span>
<form action="#" method="post" name="" id="form1"  >
    <table cellpadding="1" cellspacing="1" class="c_table">
        <tr class="r1">
            <td class='c_row0' width="120" align="right">CODE名称：</td>
            <td width="420px;"><input type="text" name="name" id="name" class="small_input" value="" /><span class="red">*</span></td>
            <td class="red"></td> 
        </tr>
        <tr class="r2">
            <td class='c_row0' align="right">CODE：</td>
            <td><input type="text" name="code" id="code" class="small_input" value="" /><span class="red">*</span></td>
            <td class="red"></td>
        </tr>
        <tr class="r1">
            <td class='c_row0' align="right">负责人(邮箱前缀)：</td>
            <td><input type="text" name="manager" id="manager" class="small_input" value=""><span class="red">*</span></td>
            <td class="red"></td>
        </tr>
        <tr class="r2">
            <td class='c_row0' align="right">负责人工号：</td>
            <td><input type="text" name="manager_unique_id" id="manager_unique_id" class="small_input" value=""><span class="red">*</span></td>
            <td class="red"></td>
        </tr>
        <tr class="r1">
            <td class='c_row0' align="right">状态： </td>
            <td>
            <?php echo CHtml::dropDownList('status' ,'1' ,$statusOption ,array('class'=>'mid_select2 bg_orange')); ?>
            </td>
            <td class="red"></td>
        </tr>
        <tr class="r2">
            <td class='c_row0'></td>
            <td>
            	<input type="hidden" value="create" name="action"  />
                <input type="hidden" value="<?php echo Yii::app()->request->csrfToken; ?>"  name="YII_CSRF_TOKEN" />
                <input type="submit" name="fsubmit" id="form_submit" class="button_grey" value=" 确 定 " />
                <input type="button" name="r" value=" 返 回 " class="button_grey" onclick="history.go(-1);" />
            </td>
            <td></td>
        </tr>
    </table>

</form>